package com.buka.config;


import io.minio.MinioClient;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.annotation.Resource;

@Data
@Configuration
@ConfigurationProperties(prefix = "minio")
public class MinioConfig {

    private String endpoint;
    private String accesskey;
    //私钥
    private String secretkey;


    @Bean
    public MinioClient minioClient() {
        return MinioClient.builder().endpoint(getEndpoint())
                .credentials(getAccesskey(), getSecretkey()).build();
    }


}
